﻿

Public Class MapaSINcabecera
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            FG.culturaPaginas()


            'Cargo páginas anterior y actual!!!
            Var_Globales.Setea_paginas("Mapa.aspx")
        End If
    End Sub


    Private Sub colorearPcia(ByRef pcia As String, ByVal cantidad As Integer, ByVal porc As Integer)

        Dim color As String
        color = ""
        pcia = Replace(pcia, " ", "")
        If UCase(pcia) = "CIUDADAUTONOMABUENOSAIRES" Then
            Exit Sub
        End If
        If (porc > 10) Then
            color = "Green"
        Else
            color = "Blue"
        End If

        Page.FindControl("img" & pcia & color).Visible = True
        Page.FindControl("img" & pcia & color)
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click

        Dim i As Integer

        Dim param(2) As ADODB.Parameter
        Dim Rs As ADODB.Recordset

        param(0) = New ADODB.Parameter
        param(0).Name = "@vacuna"
        param(0).Type = ADODB.DataTypeEnum.adVarChar
        param(0).Direction = ADODB.ParameterDirectionEnum.adParamInput
        param(0).Value = "BCG" 'HARDCODE!!!
        param(0).Size = 20

        param(1) = New ADODB.Parameter
        param(1).Name = "@RangoDesde"
        param(1).Type = ADODB.DataTypeEnum.adDate '<--campo fecha
        param(1).Direction = ADODB.ParameterDirectionEnum.adParamInput
        param(1).Value = "1/10/2013" 'HARDCODE!!!

        param(2) = New ADODB.Parameter
        param(2).Name = "@RangoDesde"
        param(2).Type = ADODB.DataTypeEnum.adDate '<--campo fecha
        param(2).Direction = ADODB.ParameterDirectionEnum.adParamInput
        param(2).Value = "10/11/2013" 'HARDCODE!!!


        Rs = Datos.TraerTodos("Trae_PorcentajeDeVacunadosXVacunaYfecha", param, "Informe1.aspx")


        Rs.MoveFirst()


        For i = 1 To Rs.RecordCount

            colorearPcia(Rs.Fields(0).Value.ToString, CInt(Rs.Fields(1).Value), CInt(Rs.Fields(2).Value))

            Rs.MoveNext()

        Next i




    End Sub

End Class